<template>
    <!-- 底部评论区 start -->
    <footer class="footer-box">
        <div class="comment-input" v-show="!showComments" @click="showComments=true">不想说点什么吗？</div>
        <!-- <div class="comment-detail" v-show="showComments" @click.self="showComments=false"> -->
        <div class="comment-detail" v-show="showComments" @click="showComments=false">
            <div class="user-input" @click.stop>
                <h4>头像</h4>
                <ul class="user-head" @click.capture.stop="chooseUserImg($event.target)">
                    <li 
                        v-for="(value,index) in 24" :key="index"
                        :user-img="`user${value}.png`" 
                        :class="`user${value}.png`==userComments.userImage?'user-choose':''"
                        :style="`background-image:url(../imgs/users/user${value}.png);`"></li>
                </ul>
                <h4>昵称</h4>
                <input class="user-nikename" type="text" placeholder="昵称" >
                <h4>评分</h4>
                <div class="film-source reset-star">
                    <span class="star-img open"></span>
                    <span class="star-img open"></span>
                    <span class="star-img open"></span>
                    <span class="star-img close"></span>
                    <span class="star-img close"></span>
                    <span class="star-source">7.9</span>
                </div>
                <h4>评论</h4>
                <textarea class="user-message" placeholder="留下点足迹..." ></textarea>
                <div class="send-btn">
                    <span @click="showComments=false">关闭</span>
                    <span >发送</span>
                </div>
            </div>
        </div>
    </footer>
    <!-- 底部评论区 end -->
</template>
<script>
    const bottomBar=Vue.extend({
        template:document.currentScript.ownerDocument.querySelector("template"),
        data(){
            return{
                showComments:false,
                userComments:{
                    userImage:"user1.png"
                }
            }
        },
        methods:{
            chooseUserImg(e){
                // console.log(e);
                // console.log(e.getAttribute("user-img"));
                this.userComments.userImage=e.getAttribute("user-img");
            }
        }
    })
</script>